﻿<div ng-controller="tokenShopCategoryController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li><a ui-sref="app.tokenShopCategory.list">品类设置</a></li>
                <li class="active" ng-bind="breadcrumb"></li>
            </ol>
        </div>
    </div>
    <form name="_form" class="form-horizontal w5c-form" w5c-form-validate="model.validateOptions" novalidate role="form">
        <div ng-if="model.depth == 2" class="form-group form-group-sm">
            <label class="col-sm-2 control-label">一级品类</label>
            <div class="col-sm-2">
                <select name="status" class="form-control input-sm" ng-model="model.parent_id_value" required>
                    <option ng-repeat="x in model.first_category_list" value="{{x.value}}">{{x.text}}</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{{model.depth==1 ? '一级名称':'二级名称'}}</label>
            <div class="col-sm-6">
                <input type="text" name="name" class="form-control input-sm" ng-model="model.name" required ng-minlength="1" ng-maxlength="25">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">图片</label>
            <div class="col-sm-5">
                <input name="img_url" type="file" ngf-select ng-model="model.file" accept="image/*" class="form-control input-sm">
                <img ng-src="{{site.img_url+model.first_url}}" class="img-thumbnail" ng-show="model.first_url" width="60" height="80">
            </div>
            <div class="col-sm-5 form-control-static">
                <span style="color:#d3d3d3"></span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">排序</label>
            <div class="col-sm-6">
                <input type="number" name="sort" class="form-control input-sm" ng-model="model.sort">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">类型</label>
            <div class="col-sm-6">
                <select name="type" class="form-control input-sm" ng-model="model.type" required>
                    <option value="-1" ng-selected="model.type==-1">请选择</option>
                    <option value="0" ng-selected="model.type==0"> 商城</option>
                    <option value="1" ng-selected="model.type==1"> 集市</option>
                </select>
            </div>
        </div>
        <div ng-if="model.id != 0" class="form-group form-group-sm">
            <label class="col-sm-2 control-label">链接地址</label>
            <div class="col-sm-8">
                <div class="col-sm-8 form-control-static">
                    {{token_api_url + 'Category/CategoryProduct?categoryId=' + model.id}}
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" w5c-form-submit="save()" class="btn btn-primary btn-sm" btn-loading="psdisabled" loading-text="保存中..." ng-disabled="psdisabled">
                    <i class="fa fa-save"></i> 保存
                </button>
                <button ng-click="goBack()" class="btn btn-primary btn-sm"><i class="fa fa-rotate-left"></i> 取消</button>
            </div>
        </div>
    </form>
</div>